//
//  ShuangSeQiuCell.m
//  K8彩票
//
//  Created by zyn on 2017/6/6.
//  Copyright © 2017年 zhoubo. All rights reserved.
//

#import "ShuangSeQiuCell.h"

@implementation ShuangSeQiuCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setContentShuangSeQiu:(NSMutableArray *)array{
    CaipiaoHistoryModel *model = array[0];
    CaipiaoHistoryModel *modelS1 = array[1];
    CaipiaoHistoryModel *modelS2 = array[2];
    
    _labelName.text = NSLocalizedString(@"双色球", @"双色球");
    _labelQiHao.text = [NSString stringWithFormat:NSLocalizedString(@"第%@期", @"第%@期"), model.issueno];
    NSArray *arrs = [model.number componentsSeparatedByString:@" "];
    _label1.text = arrs[0];
    _label2.text = arrs[1];
    _label3.text = arrs[2];
    _label4.text = arrs[3];
    _label5.text = arrs[4];
    _label6.text = arrs[5];
    _label7.text = model.refernumber;
    
    _labelS1QiHao.text = [NSString stringWithFormat:NSLocalizedString(@"第%@期", @"第%@期"),modelS1.issueno];
    NSArray *arrsS1 = [modelS1.number componentsSeparatedByString:@" "];
    _labelS11.text = arrsS1[0];
    _labelS12.text = arrsS1[1];
    _labelS13.text = arrsS1[2];
    _labelS14.text = arrsS1[3];
    _labelS15.text = arrsS1[4];
    _labelS16.text = arrsS1[5];
    _labelS17.text = modelS1.refernumber;
    
    _labelS2QiHao.text = [NSString stringWithFormat:NSLocalizedString(@"第%@期", @"第%@期"),modelS2.issueno];
    NSArray *arrsS2 = [modelS2.number componentsSeparatedByString:@" "];
    _labelS21.text = arrsS2[0];
    _labelS22.text = arrsS2[1];
    _labelS23.text = arrsS2[2];
    _labelS24.text = arrsS2[3];
    _labelS25.text = arrsS2[4];
    _labelS26.text = arrsS2[5];
    _labelS27.text = modelS2.refernumber;

    
    [_label6 setBackgroundColor:[self rgba_16:@"FE3C3C"]];
    [_labelS16 setBackgroundColor:[self rgba_16:@"FE3C3C"]];
    [_labelS26 setBackgroundColor:[self rgba_16:@"FE3C3C"]];

    
}

-(void)setContentDaLeTou:(NSMutableArray *)array{
    CaipiaoHistoryModel *model = array[0];
    CaipiaoHistoryModel *modelS1 = array[1];
    CaipiaoHistoryModel *modelS2 = array[2];
    
    _labelName.text = NSLocalizedString(@"大乐透", @"大乐透");
    _labelQiHao.text = [NSString stringWithFormat:NSLocalizedString(@"第%@期", @"第%@期"),model.issueno];
    NSArray *arrs = [model.number componentsSeparatedByString:@" "];
    NSArray *arrsBlue = [model.refernumber componentsSeparatedByString:@" "];
    _label1.text = arrs[0];
    _label2.text = arrs[1];
    _label3.text = arrs[2];
    _label4.text = arrs[3];
    _label5.text = arrs[4];
    _label6.text = arrsBlue[0];
    _label7.text = arrsBlue[1];
    
    _labelS1QiHao.text = [NSString stringWithFormat:NSLocalizedString(@"第%@期", @"第%@期"),modelS1.issueno];
    NSArray *arrsS1 = [modelS1.number componentsSeparatedByString:@" "];
    NSArray *arrsS1Blue = [modelS1.refernumber componentsSeparatedByString:@" "];
    _labelS11.text = arrsS1[0];
    _labelS12.text = arrsS1[1];
    _labelS13.text = arrsS1[2];
    _labelS14.text = arrsS1[3];
    _labelS15.text = arrsS1[4];
    _labelS16.text = arrsS1Blue[0];
    _labelS17.text = arrsS1Blue[1];
    
    _labelS2QiHao.text = [NSString stringWithFormat:NSLocalizedString(@"第%@期", @"第%@期"),modelS2.issueno];
    NSArray *arrsS2 = [modelS2.number componentsSeparatedByString:@" "];
    NSArray *arrsS2Blue = [modelS2.refernumber componentsSeparatedByString:@" "];
    _labelS21.text = arrsS2[0];
    _labelS22.text = arrsS2[1];
    _labelS23.text = arrsS2[2];
    _labelS24.text = arrsS2[3];
    _labelS25.text = arrsS2[4];
    _labelS26.text = arrsS2Blue[0];
    _labelS27.text = arrsS2Blue[1];
    
    
    [_label6 setBackgroundColor:[self rgba_16:@"0000FF"]];
    [_labelS16 setBackgroundColor:[self rgba_16:@"0000FF"]];
    [_labelS26 setBackgroundColor:[self rgba_16:@"0000FF"]];
}

-(UIColor *)rgba_16:(NSString *)colorString{
    NSInteger red = strtoul([[colorString substringWithRange:NSMakeRange(0, 2)] UTF8String],0,16);
    NSInteger green = strtoul([[colorString substringWithRange:NSMakeRange(2, 2)] UTF8String],0,16);
    NSInteger blue = strtoul([[colorString substringWithRange:NSMakeRange(4, 2)] UTF8String],0,16);
    
    return [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1];
}

@end
